<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputForm input').tooltip();
		$('#inputForm').checkForm();
		$('#inputForm').ajaxForm(
				{
					type : "post",
					dataType : "json",
					beforeSubmit : function() {
						$("#sbmBtn").attr("disabled", "disabled");
					},
					clearForm : false,
					resetForm : false,
					success : function(resp) {

						if (resp.status == '1') {
							ui.msg(resp.msg, 1);
							ui.go(_ctx + '/registry/adapter_info_list.do');
						} else {
							ui.msg(resp.msg, 0);
							$("#sbmBtn").removeClass("disabled").attr(
									"disabled", null);
						}
					},
					error : function(resp) {
						ui.msg('请求发送失败', 0);
						$("#sbmBtn").removeClass("disabled").attr("disabled",
								null);
					}
				});
	});
	
	
	
	/**
	 * 验证服务是否有效
	 */
	function validateWSDL(wsdlUrl){
		var serviceUrl = $("#"+wsdlUrl).val();
		if(serviceUrl == null || serviceUrl == ''){
			alert('请填写正确的服务地址');
			return;
		}else{
			$.ajax({
				   type: "POST",
				   url: _ctx + "/registry/AdaisWsdlAvailable.do",
				   async: true,
				   cache: false,
				   data: {serviceUrl : serviceUrl},
				   beforeSend: function(){
					  // $("#wsdlValidationBtn").val("正在校验...").attr("disabled","disabled");
			       },
				   success: function(data){
					   if(data.status == 1){
						   alert('校验成功！');
					   }else{
						   alert('校验失败！');
					   }
					//   $("#wsdlValidationBtn").val("校验服务有效性").attr("disabled",null);
				   },
				   error:function(){
					   alert('系统异常,操作失败');
					 //  $("#wsdlValidationBtn").val("校验服务有效性").attr("disabled",null);
				   }
			});		
		}
	}
	
</script>
</head>
<body>
	<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
	<c:set var="vo" value="${_data}" />
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
						<li><a href="#">注册管理</a></li>
						<li><a href="#">适配器管理</a></li>
						<li><a href="#">适配器绑定</a></li>
						<li class="active">绑定地址</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-box">
								<div class="widget-header header-color-white">
									<div class="widget-toolbar no-border">
										<a class="btn btn-primary btn-xs"
											href="${ctx}/registry/adapter_info_list.do"><i
											class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
									</div>
								</div>
								<div class="widget-body">
									<div class="widget-main">
										<form class="form-horizontal" role="form" id="inputForm"
											action="${ctx}/registry/update_adapter_info.do" method="post">
											<input type="hidden" id="id" name="id" value="${vo.id}" /> <input
												type="hidden" id="islocal" name="islocal"
												value="${vo.islocal}" /> <input type="hidden" id="nodeCode"
												name="nodeCode" value="${vo.nodeCode}" /> <input
												type="hidden" id="status" name="status" value="${vo.status}" />
												
												
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">所属节点:</div>
												<div class="col-sm-9" style="padding-top: 7px;">
												<input type="hidden" id="noDeName"
												name="noDeName" value="${vo.noDeName}" />
													${vo.noDeName}</div>
											</div>

											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">适配器编码:</div>
												<div class="col-sm-9" style="padding-top: 7px;">
												<input type="hidden" id="adapterCode"
												name="adapterCode" value="${vo.adapterCode}" />
													${vo.adapterCode}</div>
											</div>


											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">适配器名称:</div>
												<div class="col-sm-9" style="padding-top: 7px;">
													<input  type="hidden"
														value="${vo.adapterName}" name="adapterName"
														id="adapterName"/>
														${vo.adapterName}
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">接口地址(HTTP):</div>
												<div class="col-sm-9" style="padding-top: 7px;">
													<input type="text" class="col-xs-10 col-sm-5"
														value="${vo.wsdlUrl}" name="wsdlUrl" id="wsdlUrl"
														datatype="require"  msg="请填写接口地址(wsdl)！"  title="必填项,2-80个字符，允许中文，英文字母、数字和符号" />
												<span class="input-group-btn"> 
		                  </span>
												
												</div>
											</div>
											
											

											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">描述:</div>
												<div class="col-sm-9">
													<textarea class="col-sm-5" placeholder="请输入描述"
														name="remark" id="remark" title="描述">${vo.remark }</textarea>
												</div>
											</div>
											<hr>
											<div class="clearfix form-group">
												<div class="col-md-offset-3 col-md-9">
													<button type="submit" class="btn btn-sm btn-info"
														id="sbmBtn">
														<i class="icon-ok bigger-110"></i>提交
													</button>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>